<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>banner管理</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../../css/bootstrap.min.css">
    <link rel="stylesheet" href="../../css/font-awesome.min.css">
    <link rel="stylesheet" href="../../plugins/jqgrid/ui.jqgrid-bootstrap.css">
    <link rel="stylesheet" href="../../plugins/ztree/css/metroStyle/metroStyle.css">
    <link rel="stylesheet" href="../../css/main.css">
    <script src="../../libs/jquery.min.js"></script>
    <script src="../../plugins/layer/layer.js"></script>
    <script src="../../libs/bootstrap.min.js"></script>
    <script src="../../libs/vue.min.js"></script>
    <script src="../../plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="../../plugins/jqgrid/jquery.jqGrid.min.js"></script>
    <script src="../../plugins/ztree/jquery.ztree.all.min.js"></script>
    <script src="../../js/common.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.bookname" @keyup.enter="query" placeholder="书籍名称">
            </div>
            <a class="btn btn-default" @click="query">查询</a>
            <div class="btn-group" role="group" aria-label="...">
                <a v-if="hasPermission('sys:banner:save')" class="btn btn-primary btn-sm" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
                <a v-if="hasPermission('sys:banner:update')" class="btn btn-primary btn-sm" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
                <a v-if="hasPermission('sys:banner:delete')" class="btn btn-primary btn-sm" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            </div>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">书籍</div>
                <div class="col-sm-10">
                    <select v-model="banner.bookid" id="select_div" style="width: 200px">
                        <option selected  value="">全部</option>
                        <option v-for="sel in sels" v-bind:value="sel.id">{{sel.bookname}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">背景图</div>
                <div class="col-sm-10">
                    <input type="file" accept="image/gif,image/jpeg,image/jpg,image/png" ref="file" id="file" name="file" @change="changeImage($event)" class="form-control" placeholder="背景图"/>
                    <img :src="banner.bannerpic" style="max-width: 400px">
                </div>
            </div>
            <div class="form-group" style="display: flex;justify-content: flex-start;">
                <div class="col-sm-2 control-label" style="display: flex;justify-content: flex-end;align-items: center;">类型：</div>
                <div class="col-sm-10" style="display: flex;justify-content: flex-start;align-items: center">
                    <div style="display: flex;margin-right: 10px">
                        <input type="radio"  :checked="!banner.bannerType" @click="banner.bannerType=0" name="bannerType" />
                        <span>PC</span>
                    </div>
                    <div style="display:flex">
                        <input type="radio"  :checked="banner.bannerType" @click="banner.bannerType=1" name="bannerType" />
                        <span>WAP</span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>
<script src="../../js/modules/sys/banner.js"></script>
</body>
</html>